package Command;

import com.alibaba.fastjson.JSON;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

@Setter
@Getter
public class AbstractCommand implements Command {

    private CommandTypeEnum type;

    private long updateTime ;

    private long ExpireTime = -1;

    private String path;

    public AbstractCommand(CommandTypeEnum type){
        this.type = type;
    }
    public AbstractCommand(CommandTypeEnum type,long updateTime){

        this.type = type;
        this.updateTime = updateTime;
    }

    public AbstractCommand(CommandTypeEnum type,long updateTime,int ExpireTime){

        this.type = type;
        this.updateTime = updateTime;
        this.ExpireTime = ExpireTime;
    }

    public AbstractCommand(CommandTypeEnum type,String path){

        this.type = type;
        this.path = path;
    }

    public AbstractCommand(CommandTypeEnum type,String path,long ExpireTime){

        this.type = type;
        this.path = path;
        this.ExpireTime = ExpireTime;
    }


    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }

    public String getKey() {
        return null;
    }
}
